home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
ai
/
gaf200b
/
example
/
robotarm.gaf
< prev
next >
Wrap
Text File
|
1994-06-17
|
3KB
|
98 lines
CONFIGURATION
PLOT_DURATION = 5.0; ! seconds
SIM_SCHEDULE_RATE = 0.06; ! second
SIM_INC_RATE = 0.005; ! second
END_CONFIGURATION;
SEGMENT Control
CYCLE_TIME 0.06
! Name MIN MAX
IN Position (0.0, 70.0)
IN Movement (-50.0, 50.0)
IN Pos_error(-70.0, 70.0)
OUT Current (-1.0, 1.0)
IN Pos_reg (0, 1)
ENABLE = Pos_reg ;
Initialization
Current = 0;
RESET
Current = 0;
END;
! Name Below Low High Above Truth
Symbol Very_low OF Position ( 0.0, 0.0, 25.0, 30.0, 1.0)
Symbol Medium_low OF Position ( 25.0, 30.0, 30.0, 34.9, 1.0)
Symbol Medium OF Position ( 30.0, 35.0, 35.0, 40.0, 1.0)
Symbol Medium_high OF Position ( 35.1, 40.0, 40.0, 45.0, 1.0)
Symbol Very_High OF Position ( 40.0, 45.0, 70.0, 70.0, 1.0)
Symbol Neg_large OF Pos_error(-70.0, -70.0, -15.0, -05.0, 1.0)
Symbol Neg_small OF Pos_error(-15.0, -05.0, -05.0, 0.0, 1.0)
Symbol Zero OF Pos_error( -5.0, 0.0, 0.0, 5.0, 1.0)
Symbol Pos_small OF Pos_error( 0.0, 5.0, 5.0, 15.0, 1.0)
Symbol Pos_large OF Pos_error( 5.0, 15.0, 70.0, 70.0, 1.0)
Symbol Down_large OF Movement (-50.0, -50.0, -20.0, -10.0, 1.0)
Symbol Down_small OF Movement (-20.0, -10.0, -10.0, 0.0, 1.0)
Symbol Zero OF Movement (-10.0, 0.0, 0.0, 10.0, 1.0)
Symbol Up_small OF Movement ( 0.0, 10.0, 10.0, 20.0, 1.0)
Symbol Up_large OF Movement ( 10.0, 20.0, 50.0, 50.0, 1.0)
! Name Below Low High Above Truth Center
Symbol Neg_large OF Current ( -1.0, -1.0, -0.4, -0.2, 1.0, -1.0)
Symbol Neg_small OF Current ( -0.4, -0.2, -0.2, 0.0, 1.0)
Symbol Zero_value OF Current ( -0.2, 0.0, 0.0, 0.2, 1.0)
Symbol Pos_small OF Current ( 0.0, 0.2, 0.2, 0.4, 1.0)
Symbol Pos_large OF Current ( 0.2, 0.4, 1.0, 1.0, 1.0, 1.0)
!!!!!!!! Rules for looper regulator (Current)
! Pos Pos Neg Neg
! Large Small Zero Small Large
!--------------------------------------------
! UL +L +S -L -S -L
! US +L ZERO/+S -S -S -L
! Z +L +S ZERO -S -L
! DS +L +S +S ZERO/-S -L
! DL +L +S +L -S -L
!
!
IF Pos_error IS Neg_large
THEN Current IS Neg_large
IF Pos_error IS Neg_small
THEN Current IS Neg_small
IF Pos_error IS Neg_small AND Movement IS Down_small
THEN Current IS Zero_value
IF Pos_error IS Zero AND Movement IS Up_large
THEN Current IS Neg_small
IF Pos_error IS Zero AND Movement IS Up_small
THEN Current IS Neg_small
IF Pos_error IS Zero AND Movement IS Zero
THEN Current IS Zero_value
IF Pos_error IS Zero AND Movement IS Down_small
THEN Current IS Pos_small
IF Pos_error IS Zero AND Movement IS Down_large
THEN Current IS Pos_large
IF Pos_error IS Pos_small
THEN Current IS Pos_large
IF Pos_error IS Pos_small AND Movement IS Up_large
THEN Current IS Neg_large
IF Pos_error IS Pos_large
THEN Current IS Pos_large
END Control;